/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WHY
 * Date: 2022-06-12
 * Time: 16:34
 */

   class Dog{
    public int age;
    public String name;
    public  String  color;

    public void bark(){
        System.out.println(name+"叫");}
        public void swag(){
            System.out.println(name+"摇尾巴");}
            public void show(){
                System.out.println("姓名"+name+"年龄"+age+"颜色"+color);
            }
    public Dog(String name, String color) {
        this.name ="小白";
        this.color ="白色";
        System.out.println("调用带两个参数的构造方法");
    }    public Dog(int age, String name) {
        this.age = age;
        this.name = name;
        System.out.println("调用带两个参数的构造方法");
    }
    public  Dog(){
        System.out.println("不带参数的构造方法");
    }




    public Dog(int age, String name, String color) {
        this.age = age;
        this.name = name;
        this.color = color;
        System.out.println("调用带3个参数的构造方法");
    }
}





public class TestDemo {
    public static void main(String[] args) {
        Dog  dog=new Dog();

    }
}
